<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="|#{customer.systemTitle}-内容管理-专题管理|">图灵谷</title>
<div th:replace="fragments/head_admin">head</div>
<!--/***** 当前页css  start *****/-->
<!--/***** 当前页css  end *****/-->
</head>
<body>
	<div class="layui-layout layui-layout-admin">
		<div th:replace="fragments/nav_admin">导航栏</div>
		<div th:replace="fragments/menu_admin::menu(parent=content,child=special)">菜单栏</div>
		<!--/*******内容*******/-->
		<div class="layui-body">
			<div class="layui-main">
				<!--/***** 面包屑 *****/-->
				<div class="layui-elem-quote" style="margin-top: 10px;">
					<span class="layui-breadcrumb"> <a><cite>内容管理</cite></a><a th:href="@{/admin/m/base/special/list.gsp}">专题管理</a><a><cite>新增</cite></a>
					</span>
				</div>
				<!--/*******操作*******/-->
				<form th:action="@{/admin/m/base/special/add.gsp}" id="editForm" role="form" method="post" class="layui-form">
					<fieldset class="layui-elem-field layui-field-title">
						<legend>专题管理-新增</legend>
					</fieldset>
					<div class="layui-form-item">
						<label class="layui-form-label">专题类别：<span style="color: red">*</span></label>
						<div class="layui-input-block">
							<select id="typeId" name="typeId" lay-verify="required"><option th:if="${specialTypes.size()<=0}" value="">暂无</option>
								<option th:each="data : ${specialTypes}" th:value="${data.id}" th:text="${data.typeName}">typeName</option></select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">专题标题：<span style="color: red">*</span></label>
						<div class="layui-input-block">
							<input type="text" name="title" required lay-verify="title" placeholder="请输入专题标题" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">专题模型：<span style="color: red">*</span></label>
						<div class="layui-input-block">
							<select id="modelId" name="modelId" lay-verify="required"><option th:if="${models.size()<=0}" value="">暂无</option>
								<option th:each="data : ${models}" th:value="${data.id}" th:text="${data.modelName}">modelName</option></select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">专题模板：<span style="color: red">*</span></label>
						<div class="layui-input-block">
							<select id="specialTemplate" name="specialTemplate" lay-verify="specialTemplate"><option value="1">是</option>
								<option value="2">否</option></select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">是否推荐：<span style="color: red">*</span></label>
						<div class="layui-input-block">
							<select id="recommend" name="recommend" lay-verify="recommend"><option value="1">是</option>
								<option value="2">否</option></select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">关键字：</label>
						<div class="layui-input-block">
							<input type="text" name="metaKeywords" lay-verify="metaKeywords" placeholder="请输入关键字" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">描述：</label>
						<div class="layui-input-block">
							<textarea name="metaDescription" placeholder="最多输入140字" lay-verify="metaDescription" rows="3" class="layui-textarea"></textarea>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn" lay-submit="" lay-filter="submit">立即提交</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<div th:replace="fragments/footer_admin">底部版权信息等</div>
	</div>
</body>
<div th:replace="fragments/import_js_admin">引入js</div>
<!--/***** 当前页js start *****/-->
<script th:inline="javascript">
    /*<![CDATA[*/
    var form = layui.form();
    var $ = layui.jquery;
  //自定义验证规则
    var rules = {
        title : function(value) {
            if (value.length < 5 || value.length > 40) {
                return '标题在5~40个字符之间';
            }
        },
        metaKeywords : function(value) {
            if (value.length > 100) {
                return '关键字长度不能超过100';
            }
        },
        metaDdescription : function(value) {
            if (value.length < 5 || value.length > 140) {
                return '描述在5~140个字符之间';
            }
        }
    };
    form.verify(rules);
    /*]]>*/
</script>
<!--/***** 当前页js end *****/-->
</html>